package com.robotic.route.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.robotic.common.utils.DateUtils;
import com.robotic.route.domain.InspectionCalendar;
import com.robotic.route.mapper.InspectionCalendarMapper;
import com.robotic.route.service.IInspectionCalendarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 巡检任务日历Service业务层处理
 *
 * @author tian
 * @date 2025-08-22
 */
@Service
public class InspectionCalendarServiceImpl extends ServiceImpl<InspectionCalendarMapper, InspectionCalendar> implements IInspectionCalendarService
{
    @Autowired
    private InspectionCalendarMapper inspectionCalendarMapper;

    /**
     * 查询巡检任务日历
     *
     * @param id 巡检任务日历主键
     * @return 巡检任务日历
     */
    @Override
    public InspectionCalendar selectInspectionCalendarById(Long id)
    {
        return inspectionCalendarMapper.selectInspectionCalendarById(id);
    }

    /**
     * 查询巡检任务日历列表
     *
     * @param inspectionCalendar 巡检任务日历
     * @return 巡检任务日历
     */
    @Override
    public List<InspectionCalendar> selectInspectionCalendarList(InspectionCalendar inspectionCalendar)
    {
        return inspectionCalendarMapper.selectInspectionCalendarList(inspectionCalendar);
    }

    /**
     * 新增巡检任务日历
     *
     * @param inspectionCalendar 巡检任务日历
     * @return 结果
     */
    @Override
    public int insertInspectionCalendar(InspectionCalendar inspectionCalendar)
    {
        inspectionCalendar.setCreateTime(DateUtils.getNowDate());
        return inspectionCalendarMapper.insertInspectionCalendar(inspectionCalendar);
    }

    /**
     * 修改巡检任务日历
     *
     * @param inspectionCalendar 巡检任务日历
     * @return 结果
     */
    @Override
    public int updateInspectionCalendar(InspectionCalendar inspectionCalendar)
    {
        inspectionCalendar.setUpdateTime(DateUtils.getNowDate());
        return inspectionCalendarMapper.updateInspectionCalendar(inspectionCalendar);
    }

    /**
     * 批量删除巡检任务日历
     *
     * @param ids 需要删除的巡检任务日历主键
     * @return 结果
     */
    @Override
    public int deleteInspectionCalendarByIds(Long[] ids)
    {
        return inspectionCalendarMapper.deleteInspectionCalendarByIds(ids);
    }

    /**
     * 删除巡检任务日历信息
     *
     * @param id 巡检任务日历主键
     * @return 结果
     */
    @Override
    public int deleteInspectionCalendarById(Long id)
    {
        return inspectionCalendarMapper.deleteInspectionCalendarById(id);
    }
}
